﻿#region Imports
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
using CheckerWPF.Utils;
#endregion

namespace CheckerWPF.Converters
{
    public class TestConverter : IValueConverter
    {
        #region Converters
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool val = false;
            Brush brush = new SolidColorBrush(Colors.Red);

            if (Utilities.IsBoolean(value))
            {
                val = System.Convert.ToBoolean(value);
                brush = new SolidColorBrush(val ? Colors.Green : Colors.Red);
                return brush;
            }

            return brush;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
        #endregion
    }
}
